package com.xcity.game.activity.chips;

import java.util.ArrayList;
import java.util.List;

import com.xcity.db.entity.Player;
import com.xcity.game.common.Cause;
import com.xcity.game.item.ItemInfo;

public class ChipsCollectReward {

	public int gold;
	public int stone;
	public List<ItemInfo> items;
	
	public ChipsCollectReward(int gold, int stone, ItemInfo item) {
		this.gold = gold;
		this.stone = stone;
		this.items = new ArrayList<>(1);
		this.items.add(item);
	}
	
	public void doReward(Player player) {
		player.addGold(gold, Cause.CHIP_ACTIVITY);
		player.addStone(stone, Cause.CHIP_ACTIVITY);
		for (int i = 0; i < items.size(); i++) {
			ItemInfo item = items.get(i);
			player.getBag().addItemWithoutException(item.getTemplate(), item.getCount(), Cause.CHIP_ACTIVITY);
		}
	}
	
}
